/**
 * Created by bln on 16-7-5.
 */
// common variable
var common = require('./common');

// auto define common variable
var evalString = '';
Object.keys(common).forEach((e,i) => {
    evalString += `var ${e} = common.${e};`;
});
if(typeof(evalString) !== 'undefined' || evalString !== null){
    eval(evalString);
}

describe('test file upload logical',function(){
    it('upload a file should work ok',function(done){
        request
            .post(host + '/upload')
            .field('test.jpg', 'test.jpg')
            .attach('image', path.join(__dirname,'../public/head.jpg'))
            .end(function(err,ret){
                console.log(ret.text);
                done();
            });
    });
});